import { defineStore } from "pinia";
import { useStore } from "./login";
export const useUserStore = defineStore("user", {
  state() {
    return {
      username: "",
      avatar: "",
    };
  },
  getters: {
    getUsername() {
      return this.username;
    },
    getAvatar() {
      return this.avatar;
    },
  },
  actions: {
   async setVirtualRoles() {
        const adminStore = useStore();
        adminStore.setFull(true, { root: true });
        this.avatar = "https://i.gtimg.cn/club/item/face/img/2/15922_100.gif";
        this.username = "admin(未开启登录拦截)";
   
    },
    async logout() {},
    setUserInfo(userInfo = {}) {
      this.userInfo = { ...this.userInfo, ...userInfo };
    },
  },
});
